package com.bjshiwei.zhengu.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.List;

/**
 * 作者：Administrator on 2016/9/27 0027 18:23
 * 邮箱：sanjins@126.com
 */


public abstract class MyBaseAdapter<T> extends BaseAdapter {
    private List<T> datas;
    private Context context;
    public MyBaseAdapter(Context context, List<T> datas) {
        super();
        this.datas = datas;
        this.context = context;
    }
    @Override
    public int getCount() {
        return datas==null?0:datas.size();
    }

    @Override
    public Object getItem(int position) {
        return datas.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public abstract View getView(int position, View convertView, ViewGroup parent);
}
